#pragma once

class cStateManager {
  public:
    cStateManager();
    ~cStateManager();
    bool Push( void (*Function)(void* CallerPtr, Purpose Purp), void* CallerPtr = NULL);
    bool Pop( void* CallerPtr = NULL);
	bool PopAll( void* CallerPtr = NULL);
    bool Process( void* CallerPtr = NULL);

  private:
    sState* m_CurrentState;
};

struct sState {
  sState* Prev;
  void (*Function)(void* CallerPtr, Purpose Purp);

  sState()
  {
    Prev = null;
    Function = null;
  }

  ~sState()
  {
    delete Prev;
  }
};